package org.devops

def switchs(name, workdir){
    //Digit-数字化
    if(name == "digit"){
        return digit(workdir)
    }else if(name == "wisdom"){
        return wisdom(workdir)
    }else if(name == "teka"){
        return teka(workdir)
    }else{
        return "name不匹配00508315.png"
    }
}
//teka
def teka(workdir){
    tmp = """
cd ${workdir}
[ -d tmp ] ||  mkdir tmp
rm -rf tmp/*
cp gateway/target/gateway-1.0-SNAPSHOT.jar tmp/
cp upms/upms-core/target/upms-core-1.0-SNAPSHOT.jar         tmp/
cp tekaweb/target/tekaweb-1.0-SNAPSHOT.jar   tmp
cp basic/basic-core/target/basic-core-1.0-SNAPSHOT.jar   tmp
cp quality/quality-core/target/quality-core-1.0-SNAPSHOT.jar   tmp
cp tekaweb/target/tekaweb-1.0-SNAPSHOT.jar   tmp
cp concast/concast-core/target/concast-core-1.0-SNAPSHOT.jar   tmp
cp stainless/stainless-core/target/stainless-core-1.0-SNAPSHOT.jar tmp
cp socket/socket-core/target/socket-core-1.0-SNAPSHOT.jar  tmp
cd tmp
tar -zcf jar.tar.gz    *.jar
    """
    return tmp.trim()
}

//Digit-数字化
def digit(workdir){
    tmp = """
cd ${workdir}
[ -d tmp ] ||  mkdir tmp
rm -rf tmp/*
cp auth/target/auth-1.0-SNAPSHOT.jar tmp/
cp upms/target/upms-1.0-SNAPSHOT.jar         tmp/
cp gateway/target/gateway-1.0-SNAPSHOT.jar   tmp/
#cp file/target/file-1.0-SNAPSHOT.jar         tmp/
cp digitweb/target/digitweb-1.0-SNAPSHOT.jar  tmp/
cp notice/target/notice-1.0-SNAPSHOT.jar       tmp/
cp projectes/projectes-core/target/projectes-core-1.0-SNAPSHOT.jar tmp/
cp comment/comment-core/target/comment-core-1.0-SNAPSHOT.jar       tmp/
cd tmp
tar -zcf jar.tar.gz    *.jar
    """
    return tmp.trim()
}
//wisdom-证据链
def wisdom(workdir){
    tmp = """
cd ${workdir}
[ -d tmp ] ||  mkdir tmp
rm -rf tmp/*
cp auth/target/auth-1.0-SNAPSHOT.jar tmp/
cp upms/target/upms-1.0-SNAPSHOT.jar         tmp/
cp gateway/target/gateway-1.0-SNAPSHOT.jar   tmp/
#cp file/target/file-1.0-SNAPSHOT.jar         tmp/
cp supplies/supplies-api/target/supplies-api-1.0-SNAPSHOT.jar         tmp/
cp supplies/supplies-core/target/supplies-core-1.0-SNAPSHOT.jar         tmp/
cp evidenceweb/target/evidenceweb-1.0-SNAPSHOT.jar tmp/
cp auth2/oauth2-core/target/oauth2-core-1.0-SNAPSHOT.jar  tmp/
cp projectes/projectes-core/target/projectes-core-1.0-SNAPSHOT.jar tmp/
cp notice/target/notice-1.0-SNAPSHOT.jar       tmp/
cp evidenceapp/target/evidenceapp-1.0-SNAPSHOT.jar tmp/
cd tmp
tar -zcf jar.tar.gz    *.jar
    """
    return tmp.trim()
}